package org.cuatrovientos.erp.business;

import java.util.List;

import org.cuatrovientos.erp.model.ProductType;
import org.cuatrovientos.erp.dao.ProductTypeDAO;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Holds all the business logic for ProductType related management
 * @author Daniel Cobo
 * @greetz Any
 *
 */
public class ProductTypeBO implements BOGenericInterface {
	
	// Get log4j logger
	private static final Logger logger = Logger.getLogger(ProductTypeBO.class);
	
	@Autowired
    private ProductTypeDAO producttypeDAO;

	@Override
	public ProductType selectById(int id) {
		logger.info("selectById: " + id);
		return producttypeDAO.selectById(id);
	}

	@Override
	public List<ProductType> selectAll() {
		logger.info("selectAll: ");
		return producttypeDAO.selectAll();
	}



	@Override
	public void deleteById(int id) {
		logger.info("delete: " + id);
		 producttypeDAO.delete(id);
	}

	@Override
	public void insert(Object producttype) {
		logger.info("insert: " + producttype);
		producttypeDAO.insert(producttype);
	}

	@Override
	public void update(Object producttype) {
		logger.info("update: " + producttype);
		producttypeDAO.update(producttype);
	}


}
